app.controller("navController",function($scope,categoryService,userService){
	$scope.loadTopLevelCategory = function(){
		categoryService.queryTopLevelCategory().then(function success(response){
					$scope.topCategorys=response.data.data;
				});
	}
	$scope.checkUserStatus=function(){
		userService.checkUserStatus().then(function success(response){
			if (response.data.status!=="false"){
				$scope.user = response.data.data;
			}
		})
	}
	$scope.logout = function () {
		categoryService.logout().then(function success(response) {
			console.log(response);
			if (response.data.status ==="success"){
				location.href="./2login.html";
			}
		})
	}
});